package com.a2j.beans.base.code;

/**
 * Author: bzb
 * Data: 2021/8/26 23:37
 * Desc: 自定义响应码
 */
public enum ResponseCode {

    SUCCESS(200, "操作成功!"),
    FAILED(201, "请求失败!"),
    FAILED_OPERATION(202, "操作失败!"),
    FAILED_ADD(555, "新增失败!"),
    FAILED_UPDATE(556, "修改失败!"),
    FAILED_DELETE(557, "删除失败!"),
    NO_DATA(10000, "暂无数据!"),
    LOGOUT(10010, "用户已注销!"),
    PERMISSION_ERROR(10110, "用户无操作权限!"),
    PARAMETER_ERROR(10755, "参数错误!"),
    TOKEN_ERROR(10444, "Token校验失败!"),
    TOKEN_EXPIRE(10555, "Token过期已失效!"),
    TOKEN_EMPTY(10777, "Token为空!"),
    SQL_ERROR(10500, "数据查询错误!"),
    NET_ERROR(10999, "网络异常错误!"),
    UNKNOWN_ERROR(11111, "发生未知错误!"),
    UNLAWFUL_REQUEST(10101, "非法请求!");

    /**
     * 错误码
     */
    private final int code;

    /**
     * 错误描述
     */
    private final String message;

    ResponseCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
